package com.hzdesk.media.matvector.koreabatch.client.my_paperless.logic.persenter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.hzdesk.media.matvector.koreabatch.client.my_paperless.adapter.MessageContentListAdapter;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.adapter.MyMassageAdapter;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.base.BaseAdapter;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.inter.IonClickedItemListenter;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.logic.contract.IMessageContentListContract;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.utils.RecyclerViewUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2018/8/14.
 * 杭州席媒科技有限公司  Developers  刘传华  10
 * 佛祖镇楼 bug辟易
 */

public class MessageContentListPersenter implements IMessageContentListContract.IMessageContentListPersenter {


    private IMessageContentListContract.IMessageContentListView mIMessageContentListView;
    private MessageContentListAdapter messageContentListAdapter;

    public MessageContentListPersenter(IMessageContentListContract.IMessageContentListView mIMessageContentListView) {
        this.mIMessageContentListView = mIMessageContentListView;
    }
    @Override
    public void initTitle() {
        mIMessageContentListView.showTitle();
    }

    @Override
    public void initRecyclerView(RecyclerView mRecyclerView, Context mContext) {
        RecyclerViewUtils mRecyclerViewUtils =   new RecyclerViewUtils();
        messageContentListAdapter = new MessageContentListAdapter(mContext);
        mRecyclerViewUtils.initView(mRecyclerView,0,mContext, messageContentListAdapter);
        addAdapterDate();
        setDevicesManagerAdapterListener(messageContentListAdapter,mContext);
    }
    /**
     * @desc 向容器中添加数据
     * */
    private void addAdapterDate() {
        List<String> mlist = new ArrayList<>();
        for (int i = 0; i < 5; i++) {
            mlist.add("item----"+i);

        }
        messageContentListAdapter.AddItemDate(mlist);
    }
    /**
     * @desc 设置监听
     * */
    private void setDevicesManagerAdapterListener(BaseAdapter managerAdapter, final Context mContext) {
        managerAdapter.setmIonClickedItemListenter(new IonClickedItemListenter() {
            @Override
            public void onClickedItem(View view) {
                //mIMyMassageView.toMessageContentListPager();
            }

            @Override
            public void onClickedFist(int postion) {

            }

            @Override
            public void onClickedSecond(int postion) {

            }
        });
    }
}
